package com.xez.renderers
{
	import com.xez.data.WebRoot;
	
	import spark.components.LabelItemRenderer;
	
	public class WebListRenderer extends LabelItemRenderer
	{
		public function WebListRenderer()
		{
			super();
			
			height = 50;
		}
		
		override protected function drawBackground(unscaledWidth:Number, unscaledHeight:Number):void
		{
			var web:WebRoot = data as WebRoot;
			if (web)
			{
				graphics.clear();
				if (web.isvip)
					graphics.beginFill(0xFF0000);
				else
					graphics.beginFill(0x0066CC);
				
				graphics.drawRoundRect(0, 1, unscaledWidth, unscaledHeight - 2, 10, 10);
				graphics.endFill();
				
				if (web.isnew)
				{
					graphics.beginFill(0x00FF00);
					graphics.drawEllipse(1, 2, 10, 10);
					graphics.endFill();
				}
			}
		}
		
	}
}